import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
import FormHome from '@/views/formHome/Index.vue';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/formHome',
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/Index.vue'),
  },
  {
    path: '/formHome',
    name: 'formHome',
    component: FormHome,
  },
  {
    path: '/design',
    name: 'design',
    component: () =>
      import(/* webpackChunkName: "formDesign" */ '@/views/design/Index.vue'),
    children: [
      {
        path: '/formDesign',
        name: 'formDesign',
        component: () =>
          import(
            /* webpackChunkName: "formDesign" */ '@/views/formDesign/Index.vue'
          ),
      },
      {
        path: '/flowDesign',
        name: 'flowDesign',
        component: () =>
          import(
            /* webpackChunkName: "flowDesign" */ '@/views/flowDesign/Index.vue'
          ),
      },
      // {
      //   path: '/listDesign',
      //   name: 'listDesign',
      //   component: () =>
      //     import(
      //       /* webpackChunkName: "listDesign" */ '@/views/listDesign/Index.vue'
      //     ),
      // },
      // {
      //   path: '/formSetting',
      //   name: 'formSetting',
      //   component: () =>
      //     import(
      //       /* webpackChunkName: "formSetting" */ '@/views/formSetting/Index.vue'
      //     ),
      // },
    ],
  },
  {
    path: '/personal',
    name: 'personal',
    component: () => import('@/views/personal/Index.vue'),
  },
  {
    path: '/organization',
    name: 'organization',
    component: () => import('@/views/organization/Index.vue'),
  },
  {
    path: '/authManage',
    name: 'authManage',
    component: () => import('@/views/authManage/Index.vue'),
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
